#pragma once
#include<string>
#include<sstream>
#include"Event.h"

//#include"myMiniEngine/Core/KeyCodes.h"


namespace myMiniEngine {

	class MGE_API KeyEvent : public Event {
	public:
	public:
		inline int GetKeyCode() const { return keyCode; }

		EVENT_CLASS_CATEGORY(EventCategoryKeyboard | EventCategoryInput)
	protected:
		KeyEvent(int keycode)
			: keyCode(keycode) {}

		int keyCode;
	};

	class MGE_API KeyPressedEvent :public KeyEvent {
	public:

	public:
		KeyPressedEvent(int keycode, int repeatCount)
			: KeyEvent(keycode), repeatCount(repeatCount) {}

		inline int GetRepeatCount() const { return repeatCount; }

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "KeyPressedEvent: " << keyCode << " (" << repeatCount << " repeats)";
			return ss.str();
		}

		EVENT_CLASS_TYPE(KeyPressed)
	private:
		int repeatCount;
	};


	class MGE_API KeyReleasedEvent :public KeyEvent {
	public:
		KeyReleasedEvent(int keycode)
			: KeyEvent(keycode) {}

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "KeyReleasedEvent: " << keyCode;
			return ss.str();
		}

		EVENT_CLASS_TYPE(KeyReleased)
	};

	class MGE_API KeyTypedEvent :public KeyEvent {
	public:
		KeyTypedEvent(int kc) : KeyEvent(kc) {}

		std::string ToString() const override {
			std::stringstream ss;
			ss << "KeyTypeEvent: " << keyCode << std::endl;
			return ss.str();
		}
		EVENT_CLASS_TYPE(KeyTyped)

	};




}